#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;

int* trainingPlan(int* actions, int actionsSize, int* returnSize)
{
    int i = 0;
    int j = actionsSize - 1;
    while (i < j)
    {
        while (i < j && (actions[i] % 2) != 0)
        {
            i++;
        }
        while (i < j && (actions[j] % 2) == 0)
        {
            j--;
        }
        int t = 0;
        t = actions[i];
        actions[i] = actions[j];
        actions[j] = t;
    }
    *returnSize = actionsSize;
    return actions;
}